package com.zx.template.config;

import com.zx.template.interceptor.RefrechTokenExpireInterceptor;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * 向应用添加拦截器，并指定拦截器的顺序。默认都是0，按照注册顺序执行
 */
@Configuration
public class InterceptorConfig implements WebMvcConfigurer {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new RefrechTokenExpireInterceptor())
                .excludePathPatterns("/login/**").order(0);
        
    }
}
